home *** CD-ROM | disk | FTP | other *** search
- if(!speed)
- {
- _root.setFrame(this);
- gotoAndStop(random(_totalframes - 1) + 1);
- while(_currentframe == _totalframes)
- {
- gotoAndStop(random(_totalframes - 1) + 1);
- }
- speed = _root.level + 1 + random(10) / 100;
- if(this._currentframe == 1)
- {
- pname = "bomb";
- }
- else if(this._currentframe == 2)
- {
- pname = "1up";
- }
- else if(this._currentframe == 3)
- {
- pname = "big";
- }
- else if(this._currentframe == 4)
- {
- pname = "rapid fire";
- }
- }
- onEnterFrame = function()
- {
- if(_root.hud.levelmode._currentframe > 5)
- {
- removeMovieClip(this);
- }
- _root.checkFrame(this);
- if(!float && !dead)
- {
- if(_X < 52)
- {
- _X++;
- }
- if(_X > Stage.width - 52)
- {
- _X--;
- }
- _Y = _Y + speed;
- if(_Y > Stage.height)
- {
- removeMovieClip(this);
- }
- if(_root.cannon.hitTest(this))
- {
- dead = true;
- }
- if(!dead)
- {
- i = _root.depth - 50;
- while(i < _root.depth + 10)
- {
- if(eval("_root.bullet" + i).hitTest(_X,_Y,true) && !eval("_root.bullet" + i).done)
- {
- this.float = true;
- this.floatnum = i;
- eval("_root.bullet" + i).done = true;
- }
- i++;
- }
- }
- }
- else
- {
- if(!makepower)
- {
- if(pname == "bomb")
- {
- _root.word.word = "Press space to use Bomb!";
- _root.word.gotoAndPlay("fall");
- _root.bombnum = _root.bombnum + 1;
- }
- else if(pname == "1up")
- {
- sound = new Sound();
- sound.attachSound("mushroom2");
- sound.start();
- _root.word.word = "1 UP!";
- _root.word.gotoAndPlay("fall");
- _root.lives = _root.lives + 1;
- }
- else if(pname == "big")
- {
- sound = new Sound();
- sound.attachSound("mushroom1");
- sound.start();
- _root.word.word = "Bubbles now big!";
- _root.word.gotoAndPlay("fall");
- _root.bigb = true;
- _root.bigbcount = 10 * _root.fps;
- }
- else if(pname == "rapid fire")
- {
- _root.word.word = "Rapid Fire!";
- _root.word.gotoAndPlay("fall");
- _root.rapidcount = 10 * _root.fps;
- }
- makepower = true;
- }
- if(dead)
- {
- gotoAndStop(_totalframes);
- }
- _X = eval("_root.bullet" + floatnum)._x;
- _Y = eval("_root.bullet" + floatnum)._y;
- _alpha = 60;
- if(_Y <= -50)
- {
- removeMovieClip(this);
- }
- if(_Y > Stage.height + 50)
- {
- removeMovieClip(this);
- }
- }
- };
-